package com.irdstudio.tdp.executor.core.plugin.migrate;

import java.sql.Connection;
import java.sql.SQLException;
import java.util.List;

import com.irdstudio.tdp.executor.core.plugin.AbstractPlugin;
import com.irdstudio.tdp.executor.core.plugin.migrate.dao.MigrateCheckIndex;
import com.irdstudio.tdp.executor.core.plugin.migrate.dao.MigrateCheckIndexDao;

/**
 * 迁移校验指标插件,实现迁移指标的校验并记录结果
 * @author ligm
 */
public class MigrateCheckIndexPlugin extends AbstractPlugin {

	/**迁移指标配置*/
	List<MigrateCheckIndex> migrateCheckIndexList=null;
	@Override
	public boolean execute() {
		// TODO Auto-generated method stub
		migrateCheckIndexUtil indexUtil=new migrateCheckIndexUtil();
		boolean result = indexUtil.migrateCheckIndexrz(migrateCheckIndexList, this.getPluginConnection());
		return result;
	}

	@Override
	protected boolean doReadConfigureFromDB(Connection conn, String szConfIdentify) throws SQLException {
		// TODO Auto-generated method stub
		String subsCode=szConfIdentify;
		MigrateCheckIndexDao migrateCheckIndexDao=new MigrateCheckIndexDao(conn);
		String ifstr=" where subs_code= '"+subsCode+"'";
		migrateCheckIndexList = migrateCheckIndexDao.queryMigrateCheckIndexWithCond(ifstr, "");
		return true;
	}

}
